package cn.stronglink.asset.message.mq.consumer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import org.apache.activemq.command.ActiveMQTextMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;

import cn.stronglink.asset.module.rfidState.service.RfidStateJdService;

@Component("jdReceiver")
public class JdReceiver implements MessageListener {

	@Autowired
	private RfidStateJdService rfidStateJdService;
	
	@Override
	public void onMessage(Message message) {
			if (!(message instanceof ActiveMQTextMessage)) {
				return;
			}
			TextMessage tm = (TextMessage) message;
			JDThreadExcute.executorService.execute(new JdThread(tm,rfidStateJdService));

	}
	
//	public static void main(String[] args) {
//		int aa=3;
//		List<Integer> allList =new ArrayList<>(Arrays.asList(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54));
//		// System.out.println(allList.size());
//		Iterator<Integer> it = allList.iterator();
//		 while (it.hasNext()) {	
//			 int cc =it.next();
//			 if(cc==aa){
//				 it.remove();
//			 }		
//		 }
//	}
	
	 
	
}
